← Index
NYTProf Performance Profile   
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 13:50:58 2016
Reported on Fri Jan 8 13:51:29 2016

Filename(eval 1114)[/usr/share/perl5/CGI.pm:932]
StatementsExecuted 50 statements in 1.02ms
Eval Invoked At/usr/share/perl5/CGI.pm line 932
Sibling evals1, 2, 3, 4
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
82151µs51µsCGI::::CORE:regcompCGI::CORE:regcomp (opcode)
74224µs24µsCGI::::CORE:matchCGI::CORE:match (opcode)
63211µs11µsCGI::::CORE:substCGI::CORE:subst (opcode)
2115µs5µsCGI::::CORE:substcontCGI::CORE:substcont (opcode)
0000s0sCGI::::headerCGI::header
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package CGI; sub header {
2116µs17µs my($self,@p) = self_or_default(@_);
# spent 7µs making 1 call to CGI::self_or_default
31200ns my(@header);
4
518µs return "" if $self->{'.header_printed'}++ and $HEADERS_ONCE;
6
71135µs1119µs my($type,$status,$cookie,$target,$expires,$nph,$charset,$attachment,$p3p,@other) =
# spent 119µs making 1 call to CGI::Util::rearrange
8 rearrange([['TYPE','CONTENT_TYPE','CONTENT-TYPE'],
9 'STATUS',['COOKIE','COOKIES','SET-COOKIE'],'TARGET',
10 'EXPIRES','NPH','CHARSET',
11 'ATTACHMENT','P3P'],@p);
12
13 # Since $cookie and $p3p may be array references,
14 # we must stringify them before CR escaping is done.
151300ns my @cookie;
1611µs for (ref($cookie) eq 'ARRAY' ? @{$cookie} : $cookie) {
17110µs13µs my $cs = UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_;
# spent 3µs making 1 call to UNIVERSAL::isa
1812µs push(@cookie,$cs) if defined $cs and $cs ne '';
19 }
201400ns $p3p = join ' ',@$p3p if ref($p3p) eq 'ARRAY';
21
22 # CR escaping for values, per RFC 822
2311µs for my $header ($type,$status,@cookie,$target,$expires,$nph,$charset,$attachment,$p3p,@other) {
2496µs if (defined $header) {
25 # From RFC 822:
26 # Unfolding is accomplished by regarding CRLF immediately
27 # followed by a LWSP-char as equivalent to the LWSP-char.
28459µs826µs $header =~ s/$CRLF(\s)/$1/g;
# spent 21µs making 4 calls to CGI::CORE:regcomp, avg 5µs/call # spent 5µs making 4 calls to CGI::CORE:subst, avg 1µs/call
29
30 # All other uses of newlines are invalid input.
31470µs841µs if ($header =~ m/$CRLF|\015|\012/) {
# spent 30µs making 4 calls to CGI::CORE:regcomp, avg 8µs/call # spent 10µs making 4 calls to CGI::CORE:match, avg 3µs/call
32 # shorten very long values in the diagnostic
33 $header = substr($header,0,72).'...' if (length $header > 72);
34 die "Invalid header value contains a newline not followed by whitespace: $header";
35 }
36 }
37 }
38
391600ns $nph ||= $NPH;
40
411200ns $type ||= 'text/html' unless defined($type);
42
43 # sets if $charset is given, gets if not
44126µs117µs $charset = $self->charset( $charset );
# spent 17µs making 1 call to CGI::charset
45
46 # rearrange() was designed for the HTML portion, so we
47 # need to fix it up a little.
4811µs for (@other) {
49 # Don't use \s because of perl bug 21951
50117µs110µs next unless my($header,$value) = /([^ \r\n\t=]+)=\"?(.+?)\"?$/s;
# spent 10µs making 1 call to CGI::CORE:match
511496µs4476µs ($_ = $header) =~ s/^(\w)(.*)/"\u$1\L$2" . ': '.$self->unescapeHTML($value)/e;
# spent 467µs making 1 call to CGI::AUTOLOAD # spent 5µs making 2 calls to CGI::CORE:substcont, avg 2µs/call # spent 4µs making 1 call to CGI::CORE:subst
52 }
53
5418µs12µs $type .= "; charset=$charset"
# spent 2µs making 1 call to CGI::CORE:match
55 if $type ne ''
56 and $type !~ /\bcharset\b/
57 and defined $charset
58 and $charset ne '';
59
60 # Maybe future compatibility. Maybe not.
6113µs my $protocol = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';
621200ns push(@header,$protocol . ' ' . ($status || '200 OK')) if $nph;
631300ns push(@header,"Server: " . &server_software()) if $nph;
64
6512µs push(@header,"Status: $status") if $status;
661100ns push(@header,"Window-Target: $target") if $target;
671100ns push(@header,"P3P: policyref=\"/w3c/p3p.xml\", CP=\"$p3p\"") if $p3p;
68 # push all the cookies -- there may be several
691800ns push(@header,map {"Set-Cookie: $_"} @cookie);
70 # if the user indicates an expiration time, then we need
71 # both an Expires and a Date header (so that the browser is
72 # uses OUR clock)
731200ns push(@header,"Expires: " . expires($expires,'http'))
74 if $expires;
751300ns push(@header,"Date: " . expires(0,'http')) if $expires || $cookie || $nph;
761144µs1144µs push(@header,"Pragma: no-cache") if $self->cache();
# spent 144µs making 1 call to CGI::AUTOLOAD
771200ns push(@header,"Content-Disposition: attachment; filename=\"$attachment\"") if $attachment;
7814µs push(@header,map {ucfirst $_} @other);
7912µs push(@header,"Content-Type: $type") if $type ne '';
8013µs my $header = join($CRLF,@header)."${CRLF}${CRLF}";
811700ns if (($MOD_PERL >= 1) && !$nph) {
82 $self->r->send_cgi_header($header);
83 return '';
84 }
8513µs return $header;
86}
87
88;
 
# spent 24µs within CGI::CORE:match which was called 7 times, avg 3µs/call: # 4 times (10µs+0s) by CGI::header at line 31, avg 3µs/call # once (10µs+0s) by CGI::header at line 50 # once (2µs+0s) by CGI::header at line 54 # once (2µs+0s) by CGI::unescapeHTML at line 6 of (eval 1115)[CGI.pm:932]
sub CGI::CORE:match; # opcode
# spent 51µs within CGI::CORE:regcomp which was called 8 times, avg 6µs/call: # 4 times (30µs+0s) by CGI::header at line 31, avg 8µs/call # 4 times (21µs+0s) by CGI::header at line 28, avg 5µs/call
sub CGI::CORE:regcomp; # opcode
# spent 11µs within CGI::CORE:subst which was called 6 times, avg 2µs/call: # 4 times (5µs+0s) by CGI::header at line 28, avg 1µs/call # once (4µs+0s) by CGI::header at line 51 # once (2µs+0s) by CGI::unescapeHTML at line 9 of (eval 1115)[CGI.pm:932]
sub CGI::CORE:subst; # opcode
# spent 5µs within CGI::CORE:substcont which was called 2 times, avg 2µs/call: # 2 times (5µs+0s) by CGI::header at line 51, avg 2µs/call
sub CGI::CORE:substcont; # opcode